import { createApp } from 'vue'
import App from './App.vue'

import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import './styles/index.scss'

import { createPinia } from 'pinia'
import router from './router'

// 导入自定义组件
import RightToolbar from './components/RightToolbar.vue'
import DictTag from './components/DictTag.vue'
import Pagination from './components/Pagination.vue'

const app = createApp(App)

// 注册所有图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

// 注册全局组件
app.component('right-toolbar', RightToolbar)
app.component('dict-tag', DictTag)
app.component('pagination', Pagination)

app.use(ElementPlus)
app.use(createPinia())
app.use(router)

app.mount('#app')